package teach.day05;

//Set代表一种集合元素无序、不可重复的集合
//HashSet-只能去重，所有复杂度都是find,add/remove 都是O(1)

import java.util.HashSet;
import java.util.Set;

public class P01HashSetDemo {
    public static void main(String[] args) {
        int[] a = new int[]{1, 1, 16, 23, 23};
        Set<Integer> S = new HashSet<>();
        for (int i : a) {
            S.add(i);
        }
        System.out.println(S);
    }
}
